# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=shared-mime-info
pkgver=1.15
pkgrel=0
pkgdesc="Freedesktop.org Shared MIME Info"
url="http://freedesktop.org/Software/shared-mime-info"
arch="all"
license="GPL-2.0-or-later"
makedepends="libxml2-dev libxml2-utils glib-dev intltool itstool"
install="$pkgname.post-deinstall"
triggers="$pkgname.trigger=/usr/share/mime"
subpackages="$pkgname-doc $pkgname-lang"
source="https://gitlab.freedesktop.org/xdg/shared-mime-info/uploads/b27eb88e4155d8fccb8bb3cd12025d5b/shared-mime-info-$pkgver.tar.xz"

# Tests fail with itstool < 2.0.6
# https://gitlab.freedesktop.org/xdg/shared-mime-info/issues/115
options="!check"

build() {
	cd "$builddir"
	ac_cv_func_fdatasync=no ./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-update-mimedb
	make -j1
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make -j1 DESTDIR="$pkgdir" install

	mkdir -p "$pkgdir"/usr/lib
	mv "$pkgdir"/usr/share/pkgconfig "$pkgdir"/usr/lib
}

sha512sums="3666aa500dfa6a28bd0524400c47fa16d90ae61f8c80f350fd895972319ec2f511618b8a7fa3cbde621edee46fde19e4506bda62f0bd2d0ede1b08d7bdb9aef2  shared-mime-info-1.15.tar.xz"
